package com.netty.zhanglong.second;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.util.UUID;

/**
 * Description:
 *
 * @author: StriverFeng
 * @date: 2018-9-26
 * Details:
 */
public class MyClientHandler extends SimpleChannelInboundHandler<String> {
    @Override
    protected void channelRead0(ChannelHandlerContext ctx, String msg) throws Exception {
        System.out.println("server ip:"+ctx.channel().remoteAddress());
        System.out.println("server msg:"+msg);
        ctx.channel().writeAndFlush("from client: "+ UUID.randomUUID());
    }
}
